package com.wan.util;

import java.security.Timestamp;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class Test {
    public static void main(String[] args) {
        Date timeDate = null;
        System.out.println();
        String dataString = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss").format(new Date());

        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd kk:mm:ss", Locale.ENGLISH);
        dateFormat.setLenient(false);
        try {
            timeDate = dateFormat.parse(dataString);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        System.out.println(timeDate);
    }
}
